
<div class="portlet light bordered" style="margin: 15px;">
    <div class="portlet-title">
        <div class="caption">
            <span class="caption-subject bold">Merge Tasks To {{currentTask.id}}</span>
        </div>
    </div>
    <div class="portlet-body form form-horizontal">
        <div class="form-group">
            <div class="col-md-3"><b>Priority</b>: {{currentTask.priority}}</div>
            <div class="col-md-3"><b>Status</b>: {{currentTask.status}}</div>
            <div class="col-md-3"><b>Task Way</b>: {{currentTask.taskWay}}</div>
        </div>
        <div class="form-group">
            <div class="col-md-3"><b>LP Configuration Template</b>: {{currentTask.lpTemplete.description}}</div>
            <div class="col-md-3"><b>Assignee</b>: {{currentTask.assignee.firstName}} {{currentTask.assignee.lastName}}</div>
            <div class="col-md-3"><b>Planned Assignee</b>: {{currentTask.plannedAssignee.firstName}} {{currentTask.plannedAssignee.lastName}}</div>
        </div>
        <div class="form-group">
            <div class="col-md-3"><b>Package Type</b>: {{currentTask.packagingTypeSpecName}}</div>
            <div class="col-md-6"><b>Package Type Product</b>:
                        <span ng-repeat="property in currentTask.packagingTypeProduct.diverseProperties">
                             {{property.name}}: {{property.value}} {{property.unit}}&nbsp;
                         </span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-md-3"><b>Start Time</b>:{{currentTask.startTime | amDateFormat:'YYYY-MM-DD HH:mm:ss'}}</div>
            <div class="col-md-3"><b>End Time</b>: {{currentTask.endTime | amDateFormat:'YYYY-MM-DD HH:mm:ss'}}</div>
            <div class="col-md-3"><b>Date Created</b>: {{currentTask.createdWhen | amDateFormat:'YYYY-MM-DD HH:mm:ss'}}<span ng-show="task.createdBy">({{currentTask.createdBy}})</span></div>
            <div class="col-md-3"><b>Date Updated</b>: {{currentTask.updatedWhen | amDateFormat:'YYYY-MM-DD HH:mm:ss'}}<span ng-show="task.updatedBy">({{currentTask.updatedBy}})</span></div>
        </div>
        <div style="background-color:#e9edef; padding:15px 15px 5px 15px;">
            <div class="form-group">
                <div class="col-md-2">
                    <label class="bold">Item:</label>
                    <label> {{currentTask.itemSpecName}} </label>
                </div>
                <div class="col-md-2">
                    <label class="bold">Unit:</label>
                    <label> {{currentTask.unitName}}</label>
                </div>
                <div class="col-md-2">
                    <label class="bold">QTY:</label>
                    <label> {{currentTask.itemCount}} </label>
                </div>

            </div>
        </div>
        <h4 style="margin: 50px 0px 10px;"><b>Search Tasks</b></h4>
        <form name="searchForm">
            <div class="row form-group">
                <div class="col-md-3">
                    <label>Task ID</label>
                    <lt-tags-input placeholder="Enter Task ID" ng-model="search.taskIds" fill="TASK-"></lt-tags-input>
                </div>
                <div class="col-md-3">
                    <label>Assignee:</label>
                    <user-auto-complete name="assignee" allow-clear="true" ng-model="search.assigneeUserId"></user-auto-complete>
                </div>
                <div class="col-md-3" style="padding-top:20px;">
                    <waitting-btn type="button" btn-class="btn blue"
                                  ng-click="searchTask()"
                                  value="'Search'"
                                  is-ready="isReady"
                                  is-loading="searchLoading"></waitting-btn>
                </div>
            </div>
        </form>

        <div  ng-repeat="task in taskViewList" style="padding:20px 20px 10px 20px; margin-bottom:10px; background-color:#e9edef; ">
            <md-checkbox class="md-primary" ng-checked="isChecked(task)"  ng-click="toggle(task)">
                {{task.id}}
            </md-checkbox>
            <div class="form-group">
                <div class="col-md-2">
                    <label class="bold">Item:</label>
                    <label> {{task.itemSpecName}} </label>
                </div>
                <div class="col-md-2">
                    <label class="bold">Unit:</label>
                    <label> {{task.unitName}} </label>
                </div>
                <div class="col-md-2">
                    <label class="bold">QTY:</label>
                    <label> {{task.itemCount}} </label>
                </div>

            </div>

        </div>
        <pager total-count="taskList.length" page-size="pageSize"  load-content="loadContent(currentPage)"></pager>
        <div class="form-group form-actions right" >
            <waitting-btn type="button" btn-class="btn blue"   is-ready="isReady" ng-click="mergeTasks()"
                          value="'Merge'" is-loading="isLoading"></waitting-btn>
            <button type="button" class="btn default" ng-click="cancel(editForm)">Cancel</button>
        </div>
    </div>
</div>
